package com.xiahui.day10.Test1;

public class TestPenguin {
    public static void main(String[] args) {
        Penguin p = new Penguin();
        // 赋值 我们使用set方法来替代
        p.setName("小白");
        p.setHealth(-888);
        p.setSex('男');

        System.out.println("---------------------------------------------");
        Penguin X = new Penguin();
        X.setName("李明");
        X.setHealth(78);
        X.setSex('雌');

//        p.name      =       "大白";
//        p.sex = '男';
//        p.health = -999;

        System.out.println("---------------------------------------------");

        // 取值 我们使用get方法来替代
//        System.out.println(p.name);
//        System.out.println(p.sex);
//        System.out.println(p.health);
        System.out.println(p.getName());
        System.out.println(p.getSex());
        System.out.println(p.getHealth());
        System.out.println("--------------------------------------------------------");
        System.out.println(X.getName());
        System.out.println(X.getSex());
        System.out.println(X.getHealth());

    }
}
